package com.action.gulimall.cart.service;

import com.action.gulimall.cart.vo.CartItemVo;
import com.action.gulimall.cart.vo.CartVo;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @author sl shilun217@qq.com
 * @Deacription 购物车操作类
 * @date 2021/06/29/14:15
 **/
public interface CartService {

     /** @Author sl
      * @Description 添加购物项到购物车
      * @Date 17:03 2021/6/29/029
      * @Param Long skuId, Integer num
      * @return void
      **/
    void addCartItem(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    /** @Author sl
     * @Description 获取购物车购物项详情
     * @Date 17:03 2021/6/29/029
     * @Param Long skuId
     * @return com.action.gulimall.cart.vo.CartItemVo
     **/
    CartItemVo getCartItem(Long skuId);

    /** @Author sl
     * @Description 获取整个购物车
     * @Date 17:03 2021/6/29/029
     * @Param
     * @return com.action.gulimall.cart.vo.CartVo
     **/
    CartVo getCart();
    /** @Author sl
     * @Description 修改购物车购物项数量
     * @Date 17:03 2021/6/29/029
     * @Param Long skuId, Integer num
     * @return void
     **/
    void changeCartItemCount(Long skuId, Integer num);
    /** @Author sl
     * @Description 删除购物车购物项
     * @Date 17:03 2021/6/29/029
     * @Param Long skuId
     * @return void
     **/
    void deleteCartItem(Long skuId);
    /** @Author sl
     * @Description 修改购物车购物项选中状态
     * @Date 17:03 2021/6/29/029
     * @Param Long skuId, Integer checked
     * @return void
     **/
    void changeCartItemCheck(Long skuId, Integer checked);

    Long cartNum();

    List<CartItemVo> getUserCartItems() throws Exception;
}
